﻿using AutoMapper;
using Navigant.DataContracts;
using Navigant.Infrastructure.Cases;
using Navigant.Infrastructure.ClientPortals;
using Navigant.Model.Custodians;
using Navigant.Model.PreservationNotices;

namespace Navigant.Mapping
{
    public static class MappingInitializer
    {
        public static void CreateMaps()
        {
            Mapper.CreateMap<ICase, CaseContract>()
                .ConvertUsing(new CaseConverter());
            Mapper.CreateMap<CaseContract, ICase>()
                .ConvertUsing(new CaseContractConverter());
            Mapper.CreateMap<Custodian, CustodianContract>()
                .ConvertUsing(new CustodianConverter());
            Mapper.CreateMap<CustodianContract, Custodian>()
                .ConvertUsing(new CustodianContractConverter());
            Mapper.CreateMap<IClientPortal, PortalContract>()
                .ConvertUsing(new ClientPortalConverter());
            Mapper.CreateMap<PortalContract, IClientPortal>()
                .ConvertUsing(new PortalContractConverter());
            Mapper.CreateMap<PreservationNoticeTemplate, PreservationNoticeTemplateContract>()
                .ConvertUsing(new PreservationNoticeTemplateConverter());
            Mapper.CreateMap<PreservationNoticeTemplateContract, PreservationNoticeTemplate>()
                .ConvertUsing(new PreservationNoticeTemplateContractConverter());
            Mapper.CreateMap<PreservationNotice, PreservationNoticeContract>()
                .ConvertUsing(new PreservationNoticeConverter());
        }
    }
}
